package com.java.exer.mycode;

/**
 * 记录元素节点
 */
public class ListNode {
    //添加的元素
    private Object element;
    //添加元素的位置
    private int index;
    //记录下一个节点的位置
    private ListNode next;

    public ListNode(int index, Object element) {
        super();
        this.element = element;
        this.index = index;
    }


    public Object getElement() {
        return element;
    }


    public void setElement(Object element) {
        this.element = element;
    }


    public int getIndex() {
        return index;
    }


    public void setIndex(int index) {
        this.index = index;
    }


    public ListNode getNext() {
        return next;
    }


    public void setNext(ListNode next) {
        this.next = next;
    }


    @Override
    public String toString() {
        return "ListNode [nextListNode=" + element + ", index=" + index + "]";
    }

}
